<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Thymeleaf in springboot</title>
<!--    URL链接表达式-->
    <link rel="stylesheet" th:href="@{/css/bootstrap.minm.css}">
    <link rel="stylesheet" th:href="@{/css/login.css}">
    <script th:src="@{/js/jquery-3.4.1.min.js}"></script>
    <script th:src="@{/js/bootstrap.min.js}"> </script>


</head>
<body>
<h1><--变量表达式--></h1>
<h1>title</h1>
<h1 th:text="${message}">this is the tag for displaying message returned by the controller</h1>
<h3 th:text="${result}">calculation result</h3>
<!--<h3 th:text="${user1.id}">user id</h3>-->
<!--<h3 th:text="${user1.password}"> user password</h3>-->
<!--<h3 th:text="${session.user2.id}"> user id</h3>-->
<!--<h3 th:text="${session.user2.password}"> user password</h3>-->
<!--<h3 th:text="${'id:'+user1.id+',password:'+user1.password}">user information</h3>-->

<h1><--选择变量表达式--></h1>
<div th:object="${user1}">
    <h3 th:text="*{id}">user id</h3>
    <h3 th:text="*{password}">user password</h3>

</div><div th:object="${session.user2}">
    <h3 th:text="*{id}">user id</h3>
    <h3 th:text="*{password}">user password</h3>

</div></div><div th:object="${session.user2}">
    <h3 th:text="*{'user id:'+id+',user password:'+password}">user information</h3>
</div>

<h1><--消息表达式--></h1>
<p th:text="#{msg.welcome}"></p>
<p th:text="#{msg.error}"></p>

<h1><--URL消息链接表达式--></h1>
<div class="container">
    <img th:src="@{/1.jpg}"width="200" height="150"><br><br>
    <a th:href="@{https://www.baidu.com}">Baidu</a ><br>
    <a th:href="@{/toIndex}">Home</a ><br>
        <form th:action="@{/login.html}">
            Username: <input type="text" name="uname"><br><br>
            Password: <input type="text" name="pwd"><br><br>
            <button>Login</button>
        </form>
</div>
<h1><--片段表达式--></h1>
<div id="footerDiv" th:insert="~{footer::copyright}"></div>

</body>
</html>